import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86187
 * Date: 2022-10-09
 * Time: 19:10
 */
public class Test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int num = in.nextInt();
        ArrayList<Integer> array = new ArrayList<>(3 * num);

        for (int i = 0; i < 3 * num; ++i) {
            array.add(in.nextInt());
        }
        Collections.sort(array);

        long result = 0;

        int k = 1;
        while (num > 0) {
            result += array.get(array.size() - 1 - k);
            num--;
            k += 2;
        }
        System.out.println(result);
    }

    /**
     * 题解: (和自己的解法本质是相同的).
     */
    public static void main2(String[] args) {
        Scanner scan = new Scanner(System.in);
        while (scan.hasNextInt()) {
            int n = scan.nextInt();
            long[] array = new long[3 * n];
            for (int i = 0; i < (3 * n); i++) {
                array[i] = scan.nextLong();
            }
            Arrays.sort(array);
            long sum = 0;
            for (int i = 0; i < n; i++) {
                sum += array[array.length - (2 * (i + 1))];
            }
            System.out.println(sum);
        }
    }
}

// 1 2 5 5 5 8
